﻿@{
    Layout = null;
}

<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="Wiki/AdminList" method="post">
        <div class="bjui-searchBar">
            <label>关键字：</label><input type="text" id="SearchKeyWords" value="@ViewBag.SearchKeyWords" name="SearchKeyWords" class="form-control" size="15" placeholder="">&nbsp;
            
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询</a>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true">
        <thead>
            <tr>
                <th align="center"></th>
                <th align="center">标题</th>
                <th align="center">类型</th>
                <th align="center">作者</th>
                <th align="center">提交时间</th>
                <th align="center">状态</th>
                <th align="center">审核备注</th>
                <th align="center">审核日期</th>
                <th align="center">审核</th>
            </tr>
        </thead>
        <tbody>
            @if (ViewBag.Modellist != null)
            {
                int i = Int32.Parse(ViewBag.PageSize) * (Int32.Parse(ViewBag.PageCurrent) - 1) + 1;
                foreach (var item in ViewBag.Modellist)
                {
                    <tr data-id="@i">
                        <td align="center">@i</td>
                        <td align="left"><a href="Wiki/Article/@item.Id" data-toggle="navtab" data-id="WikiArticle" data-title="@item.Article_name">@item.Article_name</a></td>
                        <td align="center">@item.ArticleType_name</td>
                        <td align="center">@item.User_name</td>
                        <td align="center">@item.Createtime.ToString("yyyy-MM-dd HH:mm") </td>
                        
                            @if (item.Admin_step == 1)
                            {
                                <td align="center"><span class="blue">提交审核</span></td>
                                <td align="center">@item.Admin_remark</td>
                                <td align="center"></td>
                            }
                            else if (item.Admin_step == 2)
                            {
                                <td align="center"><span class="green">审核通过</span></td >
                                <td align="center"></td>
                                <td align="center">@item.Createtime.ToString("yyyy-MM-dd HH:mm") </td>
                            }
                            else if (item.Admin_step == 3)
                            {
                                <td align="center"><span class="magenta">审核失败</span></td>
                                <td align="center">@item.Admin_remark</td>
                                <td align="center">@item.Createtime.ToString("yyyy-MM-dd HH:ss") </td>
                            }
                            else if (item.Admin_step == 4)
                            {
                                <td align = "center"><span class="orange">再次提交</span></td >
                                <td align="center">@item.Admin_remark</td>
                                <td align="center"></td>
                            }
                            else if (item.Admin_step == 5)
                            {
                                <td align="center"><span class="red">关闭</span></td>
                                <td align="center"></td>
                                <td align="center"></td>
                            }
                            else
                            {
                                <td align="center">异常状态</td>
                                <td align="center"></td>
                                <td align="center"></td>
                            }

                        <td align="center">
                            @if (item.Admin_step == 1 || item.Admin_step == 4 || item.Admin_step == 5)
                            {
                                <a href="Wiki/AdminSuccess/@item.Id" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定审核通过？">通过</a>
                                <a href="Wiki/AdminBack/@item.Id" class="btn btn-green" data-toggle="dialog" data-width="500" data-height="150" data-id="WikiAminBack" data-title="驳回 【@item.Article_name】">驳回</a>
                            }
                            @*<a href="Wiki/AdminClose/@item.Id" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要关闭该文章吗？">关闭</a>*@
                    </tr>
                    i++;
                }
            }

        </tbody>
    </table>
</div>
<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>
        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="120">120</option>
                <option value="150">150</option>
            </select>
        </div>
        <span>&nbsp;条，共 @ViewBag.AllRecords 条</span>
    </div>
    <div class="pagination-box" data-toggle="pagination" data-total="@ViewBag.AllRecords" data-page-size="30" data-page-current="1">
    </div>
</div>

